package com.zl.tby.vo;

import com.zl.tby.model.TbyEducationStele;
import lombok.Data;
import org.noear.solon.validation.annotation.Length;
import org.noear.solon.validation.annotation.NotBlank;

/**
 * 科研宣教-解说碑
 * @author changpeng
 * @version 1.0
 * @since 2024/8/6 20:12
 */
@Data
public class TbyEducationSteleForm {
    /**主键id*/
    private Long id;
    /**名称*/
    @NotBlank(message = "名称不能为空")
    @Length(max = 20, message = "名称最大长度为20")
    private String name;
    /**经度*/
    @NotBlank(message = "经度不能为空")
    @Length(max = 32, message = "经度最大长度为32")
    private String longitude;
    /**纬度*/
    @NotBlank(message = "纬度不能为空")
    @Length(max = 32, message = "纬度最大长度为32")
    private String latitude;

    public TbyEducationStele createEntity() {
        TbyEducationStele entity = new TbyEducationStele();
        entity.setName(this.getName());
        entity.setLongitude(this.getLongitude());
        entity.setLatitude(this.getLatitude());
        return entity;
    }

    public void updateEntity(TbyEducationStele entity) {
        entity.setName(this.getName());
        entity.setLongitude(this.getLongitude());
        entity.setLatitude(this.getLatitude());
    }
}
